package com.boot.security.server.dao.mffl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.boot.security.server.model.mffl.MfflLawyerservicepeoplenumber;

@Mapper
public interface MfflLawyerservicepeoplenumberDao {

    @Select("select * from mffl_lawyerservicepeoplenumber t where t.id = #{id}")
    MfflLawyerservicepeoplenumber getById(Long id);

    @Delete("delete from mffl_lawyerservicepeoplenumber where id = #{id}")
    int delete(Long id);

    int update(MfflLawyerservicepeoplenumber mfflLawyerservicepeoplenumber);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into mffl_lawyerservicepeoplenumber(lawyerid, userid, number, createTime, updateTime, deleteTime, deleteState) values(#{lawyerid}, #{userid}, #{number}, #{createTime}, #{updateTime}, #{deleteTime}, #{deleteState})")
    int save(MfflLawyerservicepeoplenumber mfflLawyerservicepeoplenumber);
    
    int count(@Param("params") Map<String, Object> params);

    List<MfflLawyerservicepeoplenumber> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);

    //查询律师服务人数SELECT * FROM `mffl_lawyerservicepeoplenumber` WHERE lawyerid = #{Lawyerid}
    @Select("select * from mffl_lawyerservicepeoplenumber t where t.lawyerid = #{id}")
    MfflLawyerservicepeoplenumber getlawyerservicepeoplenumber(Integer Lawyerid);
}
